Release 10.1A: OpenEdge Data Management:
SQL Reference
CREATE INDEX
Creates an index on the specified table using the specified columns of the table. An index improves the performance of SQL operations whose predicates are based on the indexed column. However, an index slows performance of
INSERT,DELETE, andUPDATEoperations.Syntax
UNIQUEDoes not allow the table to contain any rows with duplicate column values for the set of columns specified for that index.
index_nameMust be unique for the given table.
table_nameThe name of the table on which the index is being built.
column_name [ , ... ]The columns on which searches and retrievals will be ordered. These columns are called the index key. When more than one column is specified in the
CREATE INDEXstatement, a concatenated index is created.ASC | DESCAllows the index to be ordered as either ascending (
ASC) or descending (DESC) on each column of the concatenated index. The default isASC.area_nameThe name of the storage area where the index and its entries are stored.
PRO_DESCRIPTIONvalueAllows you to enter a Progress 4GL description.
valueis an arbitrary character string.PRO_ACTIVE {’N’|’n’}Indicates that the index will be created as an inactive index. Inactive indexes can be created while the database is online.
Notes
Examples
- The first index you create on a table should be the most fundamental key of the table. This index (the first one created on a table) cannot be dropped except by dropping the table.
- An index slows performance of
INSERT,DELETE, andUPDATEoperations.- Use
PROUTILto activate inactive indexes.- Use
CREATE INDEXwithout thePRO_ACTIVE{’N’|’n’}attribute to create active indexes. Active indexes can only be created against an online database if the following conditions are met:This example illustrates how to create a unique index on a table:
This example shows how to create an inactive word index with the description field specified:
Authorization
Must have
DBAprivilege orINDEXprivilege on the table.Related statements
ALTER TABLE, CREATE TABLE, DROP INDEX
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |